package com.atguigu.principle.singleresponsibility;

public class SingleResponseibility2 {
    public static void main(String[] args) {
        VehicleCar car=new VehicleCar();
        car.run("小车");
        VehicleAir air=new VehicleAir();
        car.run("飞机");
        VehicleBoat boat=new VehicleBoat();
        boat.run("小船");
    }
}
class VehicleCar{
    public void run(String vehicle){
        System.out.println(vehicle+"会在公路上飞驰");
    }
}
class VehicleAir{
    public void run(String vehicle) {
        System.out.println(vehicle + "会在天上飞");
    }
}

class VehicleBoat{
    public void run(String vehicle){
        System.out.println(vehicle+"会在水里滑行");
    }
}